export function queryStringParse(): any {
  const { hash, search } = window.location;
  const strToObj = (str: string) => {
    if (!str) return {};
    const query = decodeURIComponent(str).split('?')[1];
    if (!query) return {};
    const arr = query.split('&');
    return arr.reduce((obj, item) => {
      const [key, value] = item.split('=');
      obj[key] = value;
      return obj;
    }, {});
  };
  return {
    ...strToObj(hash),
    ...strToObj(search),
  };
}
